package com.tm.fiverole.mapper;

import com.tm.fiverole.entity.RoleEntity;
import com.tm.fiverole.entity.UserEntity;
import com.tm.fiverole.entity.UserRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author wangSang
 * @create 2022-08-18 16:48
 */
@Mapper
public interface UserRoleMapper {

    /**
     * 新增用户角色中间表
     * @param userRoleEntity
     */
    void addUserRole(UserRoleEntity userRoleEntity);

    /***
     * 删除用户角色中间表
     * @param id
     */
    void deleteUserRole(@Param(value = "id") Long id);

    /**
     * 查询用户对应的角色
     * @param id
     * @return
     */
    List<RoleEntity> queryRoleId(Integer id);

    List<UserEntity> quertyId(Integer id);
}
